/*
 *  Copyright 2019-2023 oyun
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.oyun.modules.videoandbook.domain;

import com.oyun.base.BaseEntity;
import lombok.Data;
import cn.hutool.core.bean.BeanUtil;
import io.swagger.annotations.ApiModelProperty;
import cn.hutool.core.bean.copier.CopyOptions;

import java.sql.Timestamp;
import java.io.Serializable;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

/**
 * @author oyun
 * @description /
 * @date 2024-05-08
 **/
@Data
@TableName("book")
public class Book extends BaseEntity implements Serializable {

    @TableId(value = "id", type = IdType.AUTO)
    @ApiModelProperty(value = "id")
    private Long id;

    @ApiModelProperty(value = "图书名称")
    private String name;

    @ApiModelProperty(value = "名称中间码")
    private String nameCode;
    @ApiModelProperty(value = "封面路径")
    private String coverPath;

    @ApiModelProperty(value = "作者")
    private String author;

    @ApiModelProperty(value = "图书类型(字典)")
    private String type;

    @ApiModelProperty(value = "图书介绍")
    private String introduce;

    @ApiModelProperty(value = "图书分类名称(字典)")
    private String classificationName;

    @ApiModelProperty(value = "共享url")
    private String url;

    @ApiModelProperty(value = "资源路径")
    private String resourcePath;

    @ApiModelProperty(value = "出版商(字典)")
    private String publisher;

    @ApiModelProperty(value = "是否共享(0 不共享 1 共享)")
    private String share;

    @ApiModelProperty(value = "内容")
    private String content;

    @ApiModelProperty(value = "版权")
    private String copyright;

    @ApiModelProperty(value = "页面索引")
    private String pageIndex;

    @ApiModelProperty(value = "位置")
    private String position;


    @ApiModelProperty(value = "status")
    private Integer status;

    @ApiModelProperty(value = "备注")
    private String remark;

    public void copy(Book source) {
        BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true));
    }
}
